﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BL
{
    public class Vertex
    {

        public int Id { get; set; }

        public LongLat LongLat{ get; set; }

        public Vertex(int id, double longtitude, double latitude)
        {
            Id = id;
            LongLat = new LongLat(longtitude, latitude);
        }

        public Vertex()
        {
            Id = -1;
            LongLat = null;
        }

        public Vertex(int id)
        {
            Id = id;
            LongLat = null;
        }

        public static bool operator ==(Vertex a, Vertex b)
        {
            // If both are null, or both are same instance, return true.
            if (System.Object.ReferenceEquals(a, b))
            {
                return true;
            }

            // If one is null, but not both, return false.
            if (((object)a == null) || ((object)b == null))
            {
                return false;
            }

            // Return true if the fields match:
            return a.Id == b.Id;
        }

        public static bool operator !=(Vertex a, Vertex b)
        {
            return !(a == b);
        }
    }
}
